home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / WINDOWS / MOVING.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-03  |  2KB  |  51 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; window moving with mouse or keyboard
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBINI, EFLIBWIN, EFLIBBAS, EFLIBIO, EFLIBSCR,
  10.      EFLIBKBD, EFLIBTXT;
  11.  
  12. var Window : EventHandlerObjectType; UserInput : word;
  13.  
  14.  
  15. begin
  16.      { Create window using the advanced method (could be replaced with
  17.        a simple InitializeWindow call, but without a user defined text
  18.        region or automatic coordinate adjustment }
  19.      with Window do begin
  20.           Initialize; { Initializes window }
  21.  
  22.           { Width and height is 35 and 10 characters;
  23.             let the object calculate coordinates }
  24.           AdjustUsing (35, 10);
  25.  
  26.           { Define a text region (could be replaced with
  27.             "MaximizeTextCoordinates" for largest possible text region) }
  28.           SetTextCoordinates (Field.Start.X+3, Field.Start.Y+3,
  29.                               Field.Stop.X-3, Field.Stop.Y-3);
  30.  
  31.           SetHeader ('My window object.'); { Set header }
  32.  
  33.           EnableEmbedding; { Don't give loop control to window }
  34.  
  35.           Draw; { Draw this window }
  36.           Clear; { Clear text region and reset cursor position }
  37.      end;
  38.  
  39.      { Scroll text in window and allow moving }
  40.      with Window do repeat
  41.  
  42.           Window.Write ('This is a demonstation of EFLIB''s window capabilities...'+
  43.                         'press CTRL-ENTER to move window with arrow keys! ');
  44.  
  45.           Loop; { Give control to window }
  46.           IgnoreExternalEvents; { Ignore any external events }
  47.  
  48.      until IsFinished;
  49.  
  50.      Window.Intercept; { Intercept and dispose window components }
  51. end.